package pixivhelper.bravedefault.com;

public enum Hostname {
    oauth_secure_pixiv_net("oauth.secure.pixiv.net"),
    public_api_secure_pixiv_net("public-api.secure.pixiv.net"),
    app_api_pixiv_net("app-api.pixiv.net"),
    source_pixiv_net("source.pixiv.net");

    private String rawValue;

    private Hostname(String rawValue) {
        this.rawValue = rawValue;
    }

    public String getRawValue() {
        return rawValue;
    }

    public String v1() {
        return this.rawValue + "/v1";
    }

    public String v2() {
        return this.rawValue + "/v2";
    }

    public String address() {
        switch (this) {
            case source_pixiv_net:return "210.140.131.147";
            case app_api_pixiv_net:return "210.129.120.43";
            case oauth_secure_pixiv_net:return "210.129.120.43";
            case public_api_secure_pixiv_net:return "210.129.120.41";
            default:return "210.129.120.43";
        }
    }

    public static String[] allValues() {
        return new String[]{oauth_secure_pixiv_net.rawValue,
                public_api_secure_pixiv_net.rawValue,
                app_api_pixiv_net.rawValue,
                source_pixiv_net.rawValue
        };
    }

    public static Hostname[] all() {
        return new Hostname[]{oauth_secure_pixiv_net,
                public_api_secure_pixiv_net,
                app_api_pixiv_net,
                source_pixiv_net};
    }
}
